<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html>
<html>
<head>
    <title>账户信息</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <style type="text/css">
        div.group-info {
            margin-top: 10px !important;
            margin-bottom: 0px !important;
        }
        input.innerInput {
            width: 98%;
        }
    </style>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>账户信息查看</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">账户管理</a></li>
            <li class="active"><a href="#">账户信息查看</a></li>
        </ol>
     </section>
    <section class="content">
        <div class=" box box-primary">
            <div class="box-body">
                <div class=" form-inline">
        
			       <div class="form-group form-group-xs">
			                                 机构编码： <input class="form-control" type="text" id="bankAcctNo" name="bankAcctNo" placeholder="机构编码" />
			       </div>
			       <div class="form-group form-group-xs">
			                                机构名称： <input class="form-control" type="text" id="acctHolder"  name="acctHolder" placeholder="机构名称" />
			       </div>
			        <div class="form-group form-group-xs">
			                                 机构类型： <input class="form-control" type="text" id="depositBankNo" name="depositBankNo" placeholder="机构类型" />
			       </div>
                    
                   <button type="button" onclick="gridSerch();" class="btn btn-success btn-sm">查询</button>
                    
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        
        <form action="" method="post" id="BankForm">
        	<input type="hidden" id="BankOrgId" name="BankOrgId">
        </form>
        
        <form action="" method="post" id="BankAcctForm">
       		<input type="hidden" id="BankAcctOrgId" name="BankAcctOrgId">
        </form>
   </section>
    
   <%@ include file="/WEB-INF/component/commonJS.jsp"%>
   <script type="text/javascript">
		$(function() {
			$("#gridlist").jqGrid(
					{   url : "getBankAcctInfoHospData.html",
						mtype : "POST",
						datatype : "json",
						autowidth : true,
						shrinkToFit : false,
						height : 255,
						colNames : [ '账户id','机构编号','机构名称 ','机构类型 ','余额 ','可用余额','待结算金额','更新时间 ','更新人','操作 '],
						colModel : [
                                    {name : 'orgId',index : 'orgId',hidden : true , width : 100,align : "center"},
						            {name : 'orgCode',index : 'orgCode',width : 200,align : "center"},	
									{name : 'orgName',index : 'orgName',width : 80,align : "center"}, 
									{name : 'orgType',index : 'orgType',width : 120,align : "center"},
									{name : 'outstandAmtStr',index : 'outstandAmtStr',width : 120,align : "center"},
									{name : 'availableAmtStr',index : 'availableAmtStr',width : 200,align : "center",summaryType : 'sum'},
									{name : 'pendingAmtStr',index : 'pendingAmtStr',width : 140,align : "center"},
									{name : 'updDatetime',index : 'updDatetime',width : 80,align : "center"},
							        {name : 'updUser',index : 'updUser',hidden:true,width : 100,align : "center"},
									{name : 'order',index : 'order',width : 120,align : "center",
										formatter:function(val, opts,
												rowdata) {
											var str="<a href='bankLook('"+rowdata.orgId+"')'>银行账户信息查看</a>";
												+"<a href='bankAcctLook('"+rowdata.orgId+"')'>交易明细查看</a>";
										 	return str
			                    		}
									}
						],
						rowNum : 20,
						rowList : [ 10, 20, 30,50,100,500,1000],
						rownumbers : true,
						pager : "#gridpage",
						//multiselect: true, 
						viewrecords : true,
						caption : "订单查询列表",
						jsonReader : {
							repeatitems : false,
							id : "ids"
						}
					});
			$("#gridlist").jqGrid('navGrid', '#gridpage', {add : false,edit : false,del : false,search : false,refresh : false});
			$(window).trigger("resize");
		});
			   function getFoucs(obj, rowId) {
			       var text = $.trim($(obj).val());
			       if (text != null && text != "") {
			           var $checkbox = $("#jqg_gridlist_" + rowId);
			           if ($checkbox.is(":not(:checked)")) {
			               $("#gridlist").setSelection(rowId);
			           }
			       }
			   }
			   
			   //查询
			   function gridSerch() {
			       var bankAcctNo = $.trim($("#bankAcctNo").val());
			       var acctHolder = $.trim($("#acctHolder").val());
			       var depositBankName = $.trim($("#depositBankName").val());
			       var depositBankNo  = $.trim($("#depositBankNo").val());
			       $("#gridlist").jqGrid('setGridParam',{  
			    	   url:"${ctx}/acctInfoHosp/getBankAcctInfoHospData.html",
			           datatype:'json',
			           postData:{
			               "bankAcctNo":bankAcctNo,
			               "acctHolder":acctHolder,
			               "depositBankName":depositBankName,
			               "depositBankNo":depositBankNo
			           },
			           page:1
			       }).trigger("reloadGrid"); //重新载入  
			   }
			   
			   //查看银行账户信息
			     function bankLook(id) {
				   $("#BankAcctOrgId").val(id);
				   $("#BankForm").submit();
			     }
			        
			   
			   //查看交易明细
			   function bankAcctLook(id){
				   $("#BankOrgId").val(id);
				   $("#BankAcctForm").submit();
			   }
			   
			   //医疗机构信息弹窗
			     function showHospInfo(hospId) {
			         $.HN.dialog.open({
			             "id": "showHospInfo", 
			             "title": "医疗机构信息", 
			             "url": "${ctx}/stdHospInfo/hospInfoDetail.html?hospId="+hospId,
			             "data": {}, 
			             "width": 800, 
			             "height": 400, 
			             "closefunc":function() {
			                 
			             }
			         });
			     }
			     
			     //药品信息弹窗
			     function showDrugInfo(drugId) {
			         $.HN.dialog.open({
			             "id": "showDrugInfo", 
			             "title": "药品信息", 
			             "url": "${ctx}/stdDrug/drugInfoDetail.html?drugId="+drugId,
			             "data": {}, 
			             "width": 800, 
			             "height": 400, 
			             "closefunc":function() {
			                 
			             }
			         });
			     }
			     
			     //生产企业信息弹窗
			     function showCompInfo(prodCompId) {
			         $.HN.dialog.open({
			             "id": "showCompInfo", 
			             "title": "生产企业信息", 
			             "url": "${ctx}/stdCompinfo/toStdCompinfoDetail.html?compId="+prodCompId,
			             "data": {}, 
			             "width": 800, 
			             "height": 400, 
			             "closefunc":function() {
			                 
			             }
			         });
			     }
			     
			     
			     //订单明细编号 链接 订单追踪页面
			     function showOrderId(orderId) {
			        $.HN.dialog.open({
			            "id": "showOrderId", 
			            "title": "订单物流信息", 
			            "url": "${ctx}/purOrderInfo//toOrderLogisticsById.html?orderId="+orderId,
			            "data": {}, 
			            "width": 800, 
			            "height": 400, 
			            "closefunc":function() {
			                
			            }
			        });
			    } 
			     
			     
	</script>
</body>
</html>